package com.school.manager.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.school.manager.domaim.SysMenu;
import com.school.manager.entity.po.SysMenuPo;
import com.school.manager.entity.vo.SysMenuVo;
import com.school.manager.mapper.SysMenuMapper;
import com.school.manager.service.ISysMenuService;
import com.school.manager.utils.PageUtil;

import lombok.extern.slf4j.Slf4j;

/**
 * description：菜单业务实现类
 * date：2021/10/133:18 下午
 */

@Service
@Slf4j
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements ISysMenuService {
	
	@Autowired
    private SysMenuMapper sysMenuMapper;
	
	@Override
	public Page<SysMenuVo> page(SysMenuPo sysMenuPo) {
		QueryWrapper<SysMenu> queryWrapper = PageUtil.buildQueryWrapper(sysMenuPo, SysMenu.class);
        Page<SysMenu> page = new Page<>(sysMenuPo.getCurrent(), sysMenuPo.getSize());
        sysMenuMapper.selectPage(page, queryWrapper);
        return PageUtil.buildPage(page, SysMenuVo.class);
	}
	


}
